﻿<UserControl x:Class="MVVM.Northwind.Employee.View.EmployeeView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:MVVM.Northwind.Employee.ViewModel;assembly=MVVM.Northwind.Employee.ViewModel"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="500">
    <UserControl.Resources>        
        <local:EmployeeViewModel x:Key="EmpViewModel"/>
    </UserControl.Resources>
    <Grid  Width="475" Margin="5,5,5,5" DataContext="{StaticResource EmpViewModel }">        

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="88*" />
            <ColumnDefinition Width="122*" />
            <ColumnDefinition Width="65*" />
            <ColumnDefinition Width="107*" />
            <ColumnDefinition Width="121*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="24*" />
            <RowDefinition Height="41*" />
            <RowDefinition Height="40*" />
            <RowDefinition Height="44*" />
            <RowDefinition Height="42*" />
            <RowDefinition Height="49*" />
            <RowDefinition Height="71*" />
        </Grid.RowDefinitions>
        <TextBlock Text="Employee Information" Grid.ColumnSpan="5" 
                           TextAlignment="Center" FontWeight="Bold" FontSize="20" Foreground="Black" />
        <Label Content="Employee ID"  Height="30" Grid.Row="1"  Margin="5,5,5,5" />

        <TextBlock Grid.Row="1" Grid.Column="1" Margin="5,5,5,5" Text="{Binding EmployeeID,Mode=OneWayToSource}"/>

        <TextBlock Text="Last Name" Margin="5,5,5,5" Height="30" Grid.Row="2" Grid.ColumnSpan="1" />
        <TextBlock Text="First Name" Margin="5,8,5,5" Height="30" Grid.Row="3" Grid.ColumnSpan="1" />
        <TextBlock Text="Designation" Margin="5,8,5,5" Height="30" Grid.Row="4" Grid.ColumnSpan="1" />
        <TextBlock Text="Adress" Margin="5,8,5,5" Height="30" Grid.Row="5" Grid.ColumnSpan="1" />
        <TextBlock Text="D.O.B" Margin="5,8,5,5" Height="30" Grid.Row="2" Grid.Column="2" />
        <TextBlock Text="D.O.H" Margin="5,8,5,5" Height="30" Grid.Row="3" Grid.Column="2" />
        <TextBlock Text="Phone" Margin="5,8,5,5" Height="30" Grid.Row="4" Grid.Column="2" />
        <TextBox Grid.Row="2" Grid.Column="1" Margin="5,5,5,5" Text="{Binding Path=LastName, Mode=OneWayToSource}" />
        <TextBox Grid.Row="3" Grid.Column="1" Margin="5,5,5,5" Text="{Binding Path=FirstName, Mode=OneWayToSource}"/>
        <TextBox Grid.Row="4" Grid.Column="1" Margin="5,5,5,5" Text="{Binding Path=Title, Mode=OneWayToSource}"/>
        <TextBox Grid.Row="2" Grid.Column="3" Margin="5,5,5,5" Text="{Binding Path=BirthDate, Mode=OneWayToSource}"/>
        <TextBox Grid.Row="3" Grid.Column="3" Margin="5,5,5,5" Text="{Binding Path=HireDate, Mode=OneWayToSource}"/>
        <TextBox Grid.Row="4" Grid.Column="3" Margin="5,5,5,5" Text="{Binding Path=HomePhone, Mode=OneWayToSource}"/>
        <Image Grid.Row="2" Grid.Column="5" Grid.RowSpan="3" Margin="5,5,5,5"  Source="{Binding Path=Photo}"/>
        <TextBox Grid.Row="5" Grid.Column="1" Margin="5,5,5,5" Text="{Binding Path=Address, Mode=OneWayToSource}"/>
        <StackPanel Grid.Row="5" Grid.Column="2">
            <Label Name="lblCity" Content="City"/>
            <Label Name="lblState" Content="State"/>
        </StackPanel>
        <StackPanel Grid.Row="5" Grid.Column="3">
            <TextBox Margin="5,2,5,5" Text="{Binding Path=City, Mode=OneWayToSource}" />
            <TextBox Margin="5,2,5,2" Text="{Binding Path=Region, Mode=OneWayToSource}" />
        </StackPanel>
        <StackPanel Grid.Row="5" Grid.Column="4" Orientation="Horizontal">
            <Label Content="Zip" Height="30" />
            <TextBox Width ="75" Height="30" Margin="5,5,5,5" Text="{Binding Path=PostalCode, Mode=OneWayToSource}"/>
        </StackPanel>
        <Button Grid.Row="6" Grid.Column="1" Content="Save" Height="50" Command="{Binding AddEmployee}"/>
        <Button Grid.Row="6" Grid.Column="3" Content="Cancel" Height="50"/>
    </Grid>
    
</UserControl>
